import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:get/get.dart';
import 'package:search_people/utils/component/component.dart';
import 'package:search_people/value/topcolors.dart';

import 'logic.dart';

class FollowPage extends StatelessWidget {
  final logic = Get.put(FollowLogic());
  final state = Get.find<FollowLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: detailAppBar(
          context,
          title: '我的关注'
      ),
      body: Container(
        color: Colors.white,
        padding: EdgeInsets.all(10.r),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('共有10条关注'),
            SizedBox(height: 10.r,),
            Expanded(child: ListView.separated(itemBuilder: (context,index){
              return Slidable(child: Container(
                margin: EdgeInsets.all(7.r),
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Image.network('https://bkimg.cdn.bcebos.com/pic/29381f30e924b899a9018bf852490a950a7b030858e9?x-bce-process=image/resize,m_lfit,w_536,limit_1',width: 80.r,),
                    SizedBox(width: 10.r,),
                    Expanded(child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text('秦保强',style: TextStyle(color: TopColors.black_33,fontSize: 16.sp),),
                        Text('出生年代：1967',style: TextStyle(color: TopColors.black_66,fontSize: 14.sp),),
                        Text('职务：漯河市长',style: TextStyle(color: TopColors.black_66,fontSize: 14.sp),),
                      ],
                    ))
                  ],
                ),
              ),endActionPane: ActionPane(
                motion: const ScrollMotion(),
                children: [
                  SlidableAction(
                    backgroundColor: TopColors.redfb,
                    foregroundColor: Colors.white,
                    label: '取消关注',
                    onPressed: (context) {},
                  ),
                  // slidableDeleteAction(onTap: () => _deleteConversation(index))
                ],
              ),);
            },itemCount: 10, separatorBuilder: (BuildContext context, int index) => const Divider(
              height: 1,
              color: Color(0xffdcdcdc),
            ),))
          ],
        ),
      ),
    );
  }
}
